define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.recharge_rule/index',
        add_url: 'user.recharge_rule/add',
        edit_url: 'user.recharge_rule/edit',
        delete_url: 'user.recharge_rule/delete',
        export_url: 'user.recharge_rule/export',
        modify_url: 'user.recharge_rule/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id', minWidth:80,search:false},
                    // {field: 'ident', minWidth:80,sort:false, search: 'select', selectList: ea.getDataBrage('select_list_ident'), title: '端口'},
                    {field: 'title', minWidth:250, title: '规则名称',sort:false},
                    {field: 'money', minWidth:80, title: '实付金额',search:false},
                    {field: 'add_money', minWidth:80, title: '到账金额',search:false},
                    {field: 'sort', minWidth:80,sort:false, title: '排序从小到大', edit: 'text',search:false},
                    {field: 'status', minWidth:80,search:false, selectList: ea.getDataBrage('select_list_status'), title: '状态', templet: ea.table.switch},
                    {field: 'create_time', minWidth:180, title: '创建时间',search:false},
                    { title: '操作', minWidth: 150,templet: ea.table.tool , fixed:'right'},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});